# install nvm
wget https://gitee.com/Carlli/linux-auto-tasks/raw/master/libs/nvm/nvm-install-v0.37.0.sh
dos2unix nvm-install-v0.37.0.sh
bash nvm-install-v0.37.0.sh
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
echo "nvm install successfully"
rm -rf nvm-install-v0.37.0.sh


# update nvm install source, use taobao mirror
export NVM_NODEJS_ORG_MIRROR=http://npm.taobao.org/mirrors/node
source ~/.bashrc
echo "nvm update org mirror successfully"

# install node and npm libs
nvm install 14.9.0
nvm use 14.9.0
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install http-server pm2 nodemon yarn -g
echo "node and npm install successfully"
